Hello, With DXL DOORS, Can someone explain me how to convert image to byte array? I tried with a stream but I can't do it. Thanks You Jacque2013 - Mon Sep 16 10:25:11 EDT 2013 |
Re: Convert image to byte array Not sure if this answers your question, but if you have an embedded OLE or picture in an object, then you can do the following:
Object o = current
|
Re: Convert image to byte array Tony_Goodman - Tue Sep 17 06:24:05 EDT 2013 Not sure if this answers your question, but if you have an embedded OLE or picture in an object, then you can do the following:
Object o = current
Hi Jacques, What are you trying to do? If you are trying to write some sort of web service/ alternative to DOORS web access (not sure why you would want to ) I suggest you use OSLC and use DOORS web access as an agent. If you are trying to output a chunk of data for another application then the easiest way to do this is to fire DOORS in batch mode to produce an XML file for processingin the calling application. You can also use the COM interface. There are many posts on all this in this forum. If you want answers to OSLC type questions you might be better off in the JAZZ forum. You may well be over complicating your life with the method you have chosen. Richard |
Re: Convert image to byte array Richard_Good - Tue Sep 17 07:39:53 EDT 2013 Hi Jacques, What are you trying to do? If you are trying to write some sort of web service/ alternative to DOORS web access (not sure why you would want to ) I suggest you use OSLC and use DOORS web access as an agent. If you are trying to output a chunk of data for another application then the easiest way to do this is to fire DOORS in batch mode to produce an XML file for processingin the calling application. You can also use the COM interface. There are many posts on all this in this forum. If you want answers to OSLC type questions you might be better off in the JAZZ forum. You may well be over complicating your life with the method you have chosen. Richard
Thank you Richard for your answer.
I am preparing a script to export DOORS plans to WORD 2003 (via OOXML).
For the treatment of Oles, I have not found solutions to export them into WORD. What I found as solution, into differents threads, is to save the OLE ( ".PNG" format) and try to read it in binary (using a stream ) and convert it into BASE64 and put it in my XML document. But, this method doesn't work (The problem is null 'characters' in the binary stream terminating the Buffer). Now I serach for another method: I say that perhaps it is possible to convert (image : ".PNG" format) into byte array and after that convert this array to base64 and after that insert it into my XML document. Do you have an idea about this? Thanks you for help. |
Re: Convert image to byte array Jacque2013 - Tue Sep 17 08:59:06 EDT 2013
Thank you Richard for your answer.
I am preparing a script to export DOORS plans to WORD 2003 (via OOXML).
For the treatment of Oles, I have not found solutions to export them into WORD. What I found as solution, into differents threads, is to save the OLE ( ".PNG" format) and try to read it in binary (using a stream ) and convert it into BASE64 and put it in my XML document. But, this method doesn't work (The problem is null 'characters' in the binary stream terminating the Buffer). Now I serach for another method: I say that perhaps it is possible to convert (image : ".PNG" format) into byte array and after that convert this array to base64 and after that insert it into my XML document. Do you have an idea about this? Thanks you for help. I struggled with a similar problem in this post: The solution I came up with was to read the file data char by char (which allows you to read null characters) and encode them in the buffer escaped. Reading binary data files in DXL is a pain. The reason for this lies in the old unix compatibility of DOORS. On older unix systems null bytes in Files were used as a file terminator, therefore DXL does not expect null bytes in files. If you look at the .dtc files on the server repository (which are simply GZIP zipped text files) you will also see that inside these files the null bytes also have been escaped. You can extract them to plain text by the way using a simple unzip, once you reverse that escaped null bytes. Today I would go with a quick tool that will do the Base64 conversion externally (for speed reasons) and then process the data from DOORS. Maybe that helps, regards, Mathias |
Re: Convert image to byte array To this issue, we can use a standalone component that allows .net developers (including c++, c# and VB.net programmers) to conduct image to byte array conversion without using external tool, which supports convert image in multiple formats to byte array in VB, like PNG, GIF, TIFF, etc. |